#ifndef SERIALPORTTHREAD_H
#define SERIALPORTTHREAD_H

#include <QObject>
#include <QThread>
#include <QDebug>
#include <QSerialPortInfo>
#include <QSerialPort>
#include "loghelper.h"
#include <CommonHelper.h>

class SerialportThread:public QObject
{
    Q_OBJECT;
public:
    static SerialportThread* getInstance();
    explicit SerialportThread(QObject *parent = nullptr);
    QString experimentStatus="";

public:
    void serialclose();
    void serialPortSend(QByteArray);

public slots:
    void run();
    void serialPortRead_Slot();

private:
    QSerialPort *serialPort;// 串口
    QThread thread;
    static SerialportThread* Instance ;
    loghelper * logClient;
    CommonHelper* common;
    QString tempString;

};

#endif // SERIALPORTTHREAD_H
